package Pojo;

import java.util.Objects;

public class Snack {
    private Integer snackid;//id
    private String snackname;//名称
    private Integer stock;//库存
    private Integer price;//价格
    private Integer state;//上架状态


    public Snack() {
    }

    @Override
    public String toString() {
        return "Snack{" +
                "snackid=" + snackid +
                ", snackname='" + snackname + '\'' +
                ", stock=" + stock +
                ", price=" + price +
                ", state=" + state +
                '}';
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Snack snack = (Snack) o;
        return Objects.equals(snackid, snack.snackid) &&
                Objects.equals(snackname, snack.snackname) &&
                Objects.equals(stock, snack.stock) &&
                Objects.equals(price, snack.price) &&
                Objects.equals(state, snack.state);
    }

    @Override
    public int hashCode() {
        return Objects.hash(snackid, snackname, stock, price, state);
    }

    public Integer getSnackid() {
        return snackid;
    }

    public void setSnackid(Integer snackid) {
        this.snackid = snackid;
    }

    public String getSnackname() {
        return snackname;
    }

    public void setSnackname(String snackname) {
        this.snackname = snackname;
    }

    public Integer getStock() {
        return stock;
    }

    public void setStock(Integer stock) {
        this.stock = stock;
    }

    public Integer getPrice() {
        return price;
    }

    public void setPrice(Integer price) {
        this.price = price;
    }

    public Integer getState() {
        return state;
    }

    public void setState(Integer state) {
        this.state = state;
    }

    public Snack(Integer snackid, String snackname, Integer stock, Integer price, Integer state) {
        this.snackid = snackid;
        this.snackname = snackname;
        this.stock = stock;
        this.price = price;
        this.state = state;
    }
}
